/*
 * This file is part of the WebKit open source project.
 * This file has been generated by generate-bindings.pl. DO NOT MODIFY!
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

#include "config.h"

#if ENABLE(SQL_DATABASE)

#include "WebDOMTestCallback.h"

#include "DOMStringList.h"
#include "Float32Array.h"
#include "KURL.h"
#include "SerializedScriptValue.h"
#include "TestCallback.h"
#include "TestNode.h"
#include "WebDOMDOMStringList.h"
#include "WebDOMFloat32Array.h"
#include "WebDOMString.h"
#include "WebDOMTestNode.h"
#include "WebExceptionHandler.h"
#include <wtf/GetPtr.h>
#include <wtf/RefPtr.h>
#include <wtf/text/AtomicString.h>

struct WebDOMTestCallback::WebDOMTestCallbackPrivate {
    WebDOMTestCallbackPrivate(WebCore::TestCallback* object = 0)
        : impl(object)
    {
    }

    RefPtr<WebCore::TestCallback> impl;
};

WebDOMTestCallback::WebDOMTestCallback()
    : WebDOMObject()
    , m_impl(0)
{
}

WebDOMTestCallback::WebDOMTestCallback(WebCore::TestCallback* impl)
    : WebDOMObject()
    , m_impl(new WebDOMTestCallbackPrivate(impl))
{
}

WebDOMTestCallback::WebDOMTestCallback(const WebDOMTestCallback& copy)
    : WebDOMObject()
{
    m_impl = copy.impl() ? new WebDOMTestCallbackPrivate(copy.impl()) : 0;
}

WebDOMTestCallback& WebDOMTestCallback::operator=(const WebDOMTestCallback& copy)
{
    delete m_impl;
    m_impl = copy.impl() ? new WebDOMTestCallbackPrivate(copy.impl()) : 0;
    return *this;
}

WebCore::TestCallback* WebDOMTestCallback::impl() const
{
    return m_impl ? WTF::getPtr(m_impl->impl) : 0;
}

WebDOMTestCallback::~WebDOMTestCallback()
{
    delete m_impl;
    m_impl = 0;
}

bool WebDOMTestCallback::callbackWithNoParam()
{
    if (!impl())
        return false;

    return impl()->callbackWithNoParam();
}

bool WebDOMTestCallback::callbackWithArrayParam(const WebDOMFloat32Array& arrayParam)
{
    if (!impl())
        return false;

    return impl()->callbackWithArrayParam(toWebCore(arrayParam));
}

bool WebDOMTestCallback::callbackWithSerializedScriptValueParam(const WebDOMString& srzParam, const WebDOMString& strArg)
{
    if (!impl())
        return false;

    return impl()->callbackWithSerializedScriptValueParam(WebCore::SerializedScriptValue::create(WTF::String(srzParam)), strArg);
}

int WebDOMTestCallback::callbackWithNonBoolReturnType(const WebDOMString& strArg)
{
    if (!impl())
        return 0;

    return impl()->callbackWithNonBoolReturnType(strArg);
}

bool WebDOMTestCallback::callbackWithStringList(const WebDOMDOMStringList& listParam)
{
    if (!impl())
        return false;

    return impl()->callbackWithStringList(toWebCore(listParam));
}

bool WebDOMTestCallback::callbackWithBoolean(bool boolParam)
{
    if (!impl())
        return false;

    return impl()->callbackWithBoolean(boolParam);
}

bool WebDOMTestCallback::callbackRequiresThisToPass(int longParam, const WebDOMTestNode& testNodeParam)
{
    if (!impl())
        return false;

    return impl()->callbackRequiresThisToPass(longParam, toWebCore(testNodeParam));
}

WebCore::TestCallback* toWebCore(const WebDOMTestCallback& wrapper)
{
    return wrapper.impl();
}

WebDOMTestCallback toWebKit(WebCore::TestCallback* value)
{
    return WebDOMTestCallback(value);
}

#endif // ENABLE(SQL_DATABASE)
